package com.ant.storage.service;

import com.ant.storage.common.ResultVo;
import com.ant.storage.dto.InventoryDto;
import com.ant.storage.excel.InventoryCensusExecl;
import com.ant.storage.pojo.Commodity;
import com.ant.storage.pojo.Inventory;
import com.ant.storage.vo.CommodityVo;
import com.ant.storage.vo.InventoryCensusVo;
import com.ant.storage.vo.WarehouseAndCommodityVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;


/**
 * <p>
 *  服务类
 * </p>
 *
 * @author melon
 * @since 2022-03-16
 */
public interface IInventoryService extends IService<Inventory> {


    PageInfo<Inventory> querylist(InventoryDto inventoryDto);

    /**
     * 出库商品剩余数量判定
     * @param commodity_id  商品id
     * @param warehouse_id  仓库id
     * @param commodity_inventory  商品数量
     */
    boolean commodityInventoryJudge(Integer commodity_id,Integer warehouse_id,Integer commodity_inventory);

    void stockSubtract(Integer warehouse_id, Integer commodity_id, Integer commodity_out_quantity);

    void stockAdd(Integer warehouse_id, Integer commodity_id, Integer commodity_enter_quantity);

    List<CommodityVo> findWarehouseAndInventory(Integer id);

    List<InventoryCensusVo> censusList(InventoryDto dto);

    ResultVo uploadInventory(MultipartFile file) throws IOException;

    Commodity SaveCommodity(Commodity commodity);

    Commodity selectCommodity(String name);

    void insertLog(Inventory inventory);

    void inventoryUpate(String total_num, Inventory one);

    Commodity getOneCommodityId(String commodity_bar_code);

    List<InventoryCensusExecl> exportCensus(Integer warehouseId,String  commodityType,List<String> previousTime,List<String> time);

    InventoryCensusExecl exportCensusTotal(Integer warehouseId, List<String> previousTime, List<String> time);

    List<InventoryCensusVo> balanceList(InventoryDto dto);

    List<CommodityVo> findWarehouseCarInventory(Integer id);

    ResultVo findInventoryAdjust(WarehouseAndCommodityVo dto);
}
